package com.wangshouyu.mp.message;

import com.thoughtworks.xstream.annotations.XStreamAlias;

import java.math.BigDecimal;
import java.util.Objects;

/**
 * @author 王守钰
 * @date 2020年12月07日 10:25
 * @description 请求消息
 */
@XStreamAlias(value = "xml")
public class RequestMessage extends BaseMessage{

    /**
     * 事件
     */
    @XStreamAlias(value = "Event")
    private String event;

    /**
     * 消息内容
     */
    @XStreamAlias(value = "Content")
    private String content;

    /**
     * 消息编号
     */
    @XStreamAlias(value = "MsgId")
    private Long msgId;

    /**
     * 图片地址
     */
    @XStreamAlias(value = "PicUrl")
    private String picUrl;

    /**
     * 媒体编号
     */
    @XStreamAlias(value = "MediaId")
    private String mediaId;

    /**
     * 语音格式
     */
    @XStreamAlias(value = "Format")
    private String format;

    /**
     * 语音识别结果
     */
    @XStreamAlias(value = "Recognition")
    private String recognition;

    /**
     * 视频缩略媒体Id
     */
    @XStreamAlias(value = "ThumbMediaId")
    private String thumbMediaId;

    /**
     * 地理位置维度
     */
    @XStreamAlias(value = "Location_X")
    private String locationX;

    /**
     * 地理位置经度
     */
    @XStreamAlias(value = "Location_Y")
    private String locationY;

    /**
     * 地图缩放大小
     */
    @XStreamAlias(value = "Scale")
    private Integer scale;

    /**
     * 地理位置消息：地理位置信息
     */
    @XStreamAlias(value = "Label")
    private String label;

    /**
     * Url消息标题
     */
    @XStreamAlias(value = "Title")
    private String title;

    /**
     * Url消息描述
     */
    @XStreamAlias(value = "Description")
    private String description;

    /**
     * Url消息地址
     */
    @XStreamAlias(value = "Url")
    private String url;

    /**
     * 按键key
     */
    @XStreamAlias(value = "EventKey")
    private String eventKey;

    /**
     * 二维码的ticket
     */
    @XStreamAlias(value = "Ticket")
    private String ticket;

    /**
     * 地理位置纬度
     */
    @XStreamAlias(value = "Latitude")
    private BigDecimal latitude;

    /**
     * 地理位置经度
     */
    @XStreamAlias(value = "Longitude")
    private BigDecimal longitude;

    /**
     * 地理位置精度
     */
    @XStreamAlias(value = "Precision")
    private BigDecimal precision;

    /**
     * 业务按钮id
     */
    @XStreamAlias(value = "bizmsgmenuid")
    private String bizMsgMenuId;

    /**
     * 模板消息发送时代表发送状态
     */
    @XStreamAlias(value = "Status")
    private String status;

    public String getEvent() {
        return event;
    }

    public void setEvent(String event) {
        this.event = event;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Long getMsgId() {
        return msgId;
    }

    public void setMsgId(Long msgId) {
        this.msgId = msgId;
    }

    public String getPicUrl() {
        return picUrl;
    }

    public void setPicUrl(String picUrl) {
        this.picUrl = picUrl;
    }

    public String getMediaId() {
        return mediaId;
    }

    public void setMediaId(String mediaId) {
        this.mediaId = mediaId;
    }

    public String getFormat() {
        return format;
    }

    public void setFormat(String format) {
        this.format = format;
    }

    public String getRecognition() {
        return recognition;
    }

    public void setRecognition(String recognition) {
        this.recognition = recognition;
    }

    public String getThumbMediaId() {
        return thumbMediaId;
    }

    public void setThumbMediaId(String thumbMediaId) {
        this.thumbMediaId = thumbMediaId;
    }

    public String getLocationX() {
        return locationX;
    }

    public void setLocationX(String locationX) {
        this.locationX = locationX;
    }

    public String getLocationY() {
        return locationY;
    }

    public void setLocationY(String locationY) {
        this.locationY = locationY;
    }

    public Integer getScale() {
        return scale;
    }

    public void setScale(Integer scale) {
        this.scale = scale;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getEventKey() {
        return eventKey;
    }

    public void setEventKey(String eventKey) {
        this.eventKey = eventKey;
    }

    public String getTicket() {
        return ticket;
    }

    public void setTicket(String ticket) {
        this.ticket = ticket;
    }

    public BigDecimal getLatitude() {
        return latitude;
    }

    public void setLatitude(BigDecimal latitude) {
        this.latitude = latitude;
    }

    public BigDecimal getLongitude() {
        return longitude;
    }

    public void setLongitude(BigDecimal longitude) {
        this.longitude = longitude;
    }

    public BigDecimal getPrecision() {
        return precision;
    }

    public void setPrecision(BigDecimal precision) {
        this.precision = precision;
    }

    public String getBizMsgMenuId() {
        return bizMsgMenuId;
    }

    public void setBizMsgMenuId(String bizMsgMenuId) {
        this.bizMsgMenuId = bizMsgMenuId;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        RequestMessage that = (RequestMessage) o;
        return Objects.equals(event, that.event) &&
                Objects.equals(content, that.content) &&
                Objects.equals(msgId, that.msgId) &&
                Objects.equals(picUrl, that.picUrl) &&
                Objects.equals(mediaId, that.mediaId) &&
                Objects.equals(format, that.format) &&
                Objects.equals(recognition, that.recognition) &&
                Objects.equals(thumbMediaId, that.thumbMediaId) &&
                Objects.equals(locationX, that.locationX) &&
                Objects.equals(locationY, that.locationY) &&
                Objects.equals(scale, that.scale) &&
                Objects.equals(label, that.label) &&
                Objects.equals(title, that.title) &&
                Objects.equals(description, that.description) &&
                Objects.equals(url, that.url) &&
                Objects.equals(eventKey, that.eventKey) &&
                Objects.equals(ticket, that.ticket) &&
                Objects.equals(latitude, that.latitude) &&
                Objects.equals(longitude, that.longitude) &&
                Objects.equals(precision, that.precision) &&
                Objects.equals(bizMsgMenuId, that.bizMsgMenuId) &&
                Objects.equals(status, that.status);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), event, content, msgId, picUrl, mediaId, format, recognition, thumbMediaId, locationX, locationY, scale, label, title, description, url, eventKey, ticket, latitude, longitude, precision, bizMsgMenuId, status);
    }

    @Override
    public String toString() {
        return "RequestMessage{" +
                "event='" + event + '\'' +
                ", content='" + content + '\'' +
                ", msgId=" + msgId +
                ", picUrl='" + picUrl + '\'' +
                ", mediaId='" + mediaId + '\'' +
                ", format='" + format + '\'' +
                ", recognition='" + recognition + '\'' +
                ", thumbMediaId='" + thumbMediaId + '\'' +
                ", locationX='" + locationX + '\'' +
                ", locationY='" + locationY + '\'' +
                ", scale=" + scale +
                ", label='" + label + '\'' +
                ", title='" + title + '\'' +
                ", description='" + description + '\'' +
                ", url='" + url + '\'' +
                ", eventKey='" + eventKey + '\'' +
                ", ticket='" + ticket + '\'' +
                ", latitude=" + latitude +
                ", longitude=" + longitude +
                ", precision=" + precision +
                ", bizMsgMenuId='" + bizMsgMenuId + '\'' +
                ", status='" + status + '\'' +
                '}';
    }
}
